<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function changeCode() {
            document.getElementById("code").src = '/kaptcha?' + new Date();
        }
    </script>
</head>
<body>
<form th:action="@{/login}" method="post">
    <table>
        <tr>
            <td>用户名</td>
            <td><input name="username"></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input name="password" type="password"></td>
        </tr>
        <tr>
            <td>验证码</td>
            <td>
                <input name="code">
                <img style="cursor: pointer;" id="code" th:src="@{/kaptcha}" onclick="changeCode()">
                <span th:text="${msg}"/>
            </td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="登录"></td>
        </tr>
    </table>
</form>
</body>
</html>